import threading
import os



def worker():
    print(f"worker 子线程的进程 pid = {os.getpid()}")
    print(f"worker 子线程开始工作 ,子线程:{threading.get_ident()}")

if __name__ == "__main__":
    print(f"主进程pid={os.getpid()},主线程:{threading.get_ident()}")
    th = threading.Thread(target=worker)
    th.start()
    th.join()


